<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <%        HttpSession s = request.getSession();
        String roll_index = s.getAttribute("roll").toString();
        if (s.getAttribute("full_name") != null)  {

        } else {
            response.sendRedirect("login.jsp");
        }
    %>     


    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Supportive Learning</title>
        <link href="css/index_css.css" rel="stylesheet" type="text/css"/>

        <!-- Chu chuyen dong-->
        <script language="JavaScript" type="text/javascript">
            window.setInterval('settime()', 1000);

            st = "Supportive Learning ! ";
            function chuchuyendong() {
                //lay ki tu dau tien 
                ch = st.charAt(0);
                //lay 1 chuoi con duoc cat tu vi tri thu 2 den het chuoi
                stcon = st.substring(1);
                //ghep
                st = stcon + ch;
                //in chuoi
                document.title = st;
            }
            window.setInterval('chuchuyendong()', 500);
        </script>
        <!-- end chu chuyen dong-->
    </head>

    <body>        

        <div class="wrapper">
            <div class="header">   
                <h1 style="margin: 0px; padding: 5px;">Supportive Learning</h1>
                <%
                    if (!roll_index.equals("admin")) {
                %>
                <div class="menu" style="margin: 3px 0 0 430px">                  
                    <ul>
                        <li><a href="index.jsp?page=home">Home</a></li>
                        <li><a href="index.jsp?page=class">Class</a></li>
                        <li><a href="index.jsp?page=feedback">FeedBack</a></li>
                        <li><a href="index.jsp?page=changepass">Change Password</a></li>                        
                        <li><a href="logout.jsp">Log out</a></li>
                    </ul>
                </div>   
                <%
                    }
                %>                             

                <%
                    if (!roll_index.equals("staff")) {
                %>
                <div class="menu">
                    <ul>
                        <li><a href="index.jsp?page=home">Home</a></li>
                        <li><a href="index.jsp?page=account">Account Management</a></li>
                        <li><a href="index.jsp?page=class">Class Management</a></li>                           
                        <li><a href="index.jsp?page=feedback">FeedBack</a></li>  
                        <li><a href="index.jsp?page=faq">FAQ Management</a></li> 
                        <li><a href="index.jsp?page=changepass">Change Password</a></li>
                        <li><a href="logout.jsp">Log out</a></li>
                    </ul>            
                </div>            
                <%
                    }
                %>    

            </div>
            <!--            end header-->
            <div class="wellcome">       
                <span style="float: right; padding-right: 5px;">Welcome: <%= session.getAttribute("full_name")%></span>
            </div>
            <!--end welcome            -->

            <div class="content">
                <div class="rightcontent">

                    <%    String page1 = request.getParameter("page");
                        if (page1 != null) {
                            if (page1.equals("home")) {%>
                    <%@include  file="welcome.jsp" %>              
                    <% } else if (page1.equals("account")) {%> 
                    <%@include  file="page/pg_admin/list_acc.jsp" %>              
                    <% } else if (page1.equals("createuser")) {%> 
                    <%@include  file="page/pg_admin/create_acc.jsp" %>              
                    <% } else if (page1.equals("faq")) {%> 
                    <%@include  file="page/pg_FAQ/list_FAQ.jsp" %>              
                    <% } else if (page1.equals("edituser")) {%>  
                    <%@include  file="page/pg_admin/update_acc.jsp" %>  
                    <% } else if (page1.equals("create_FAQ")) {%>  
                    <%@include  file="page/pg_FAQ/create_FAQ.jsp" %>  
                    <% } else if (page1.equals("create_class")) {%>  
                    <%@include  file="page/pg_class/create_class.jsp" %>  
                    <% } else if (page1.equals("class")) {%>  
                    <%@include  file="page/pg_class/list_class.jsp" %>  
                    <% } else if (page1.equals("update_class")) {%> 
                    <%@include  file="page/pg_class/update_class.jsp" %>                      
                    <% } else if (page1.equals("update_FAQ")) {%>  
                    <%@include  file="page/pg_FAQ/update_FAQ.jsp" %>  
                    <% } else if (page1.equals("feedback")) {
                    %> 
                    <%@include  file="page/pg_feedback/list_feedback.jsp" %>  
                    <% } else if (page1.equals("update_FeedBack")) {%> 
                    <%@include  file="page/pg_feedback/update_feedback.jsp" %>                   
                    <% } else if (page1.equals("create_assign")) {%> 
                    <%@include  file="page/pg_assign/create_assign.jsp" %>  
                    <% } else if (page1.equals("update_assign")) {%> 
                    <%@include  file="page/pg_assign/update_assign.jsp" %>                     
                    <% } else if (page1.equals("listfaq")) {%> 
                    <%@include  file="page/pg_FAQ/showFAQ.jsp" %>  
                    <% } else if (page1.equals("showassign")) {%> 
                    <%@include  file="page/pg_assign/showAssign.jsp" %>  
                    <% } else if (page1.equals("FAQdetail")) {%> 
                    <%@include  file="page/pg_FAQ/DetailFAQ.jsp" %>  
                    <% } else if (page1.equals("set_mark")) {%> 
                    <%@include  file="page/pg_assign/set_mark.jsp" %>  
                    <% } else if (page1.equals("changepass")) {%> 
                    <%@include  file="page/pg_admin/change_pass.jsp" %>  
                    <% } else if (page1.equals("addStudentInClass")) {%> 
                    <%@include  file="page/pg_student/add_student.jsp" %>  
                    <% }
                    } else { %>                        
                    <%@include  file="welcome.jsp" %>  
                    <% }
                    %>

                </div>     <!--                end right content-->

            </div> <!--            end content-->

            <div class="footer">
                <p><a href="#">HOME PAGE</a> | <a href="#">ABOUT</a> | <a href="#">HELP</a> | <a href="#">OUR TEAM</a> | <a href="#">CONTACTS</a><br/>
                    Copyright &copy; Class | Design by <a href="#">Class</a></p>
            </div>

        </div>
        <!--        end wrapper-->

    </body>
</html>
